*Paper: "The Gender Promotion Gap: Evidence from Central Banking" (RESTAT MS 22860)
*File: Campaigns regressions.do
*Authors: Laura Hospido (laura.hospido@bde.es) & Luc Laeven (Luc.laeven@ecb.int) & Ana Lamo (ana.lamo@ecb.int)
*This version: October 2020
*---------------------------------------------------------------------------

clear all
set more off
global master_ECB `""D:\Data""' /*to be changed by the user*/
cd $master_ECB

sysdir set PLUS "D:\ado\plus"  /*to be changed by the user*/


import  delimited campaigns, case(preserve) clear
run labels2.do

gen lpanelsize=log(panelsize)
label var lpanelsize "Size of selection panel"

gen female_children = female*children 
label var female_children "Female x Children"

gen female_com100= female*com100
label var female_com100 "Female x Competition index"

gen female_Ducom100F=female*Ducom100F
label var female_Ducom100F "Female x Dummy female competition"

gen female_externalC=female*externalC
label var female_externalC "Female x External campaign"

*-------------------------------------------------------------------------
*******Table 4: Probability of applying: Campaigns data
*-------------------------------------------------------------------------
eststo clear  
eststo: regress candidate i.campaign female mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6 , vce (cluster campaign) 
eststo: regress candidate i.campaign female mtenure y2_topPerf y2_bonus y2_mentee  sumMatAdop sumPLeave dir2-dir9 age1-age6 , vce (cluster campaign) 
eststo: regress candidate i.campaign female mtenure y2_topPerf y2_bonus y2_mentee 				children   dir2-dir9 age1-age6 , vce (cluster campaign)
eststo: regress candidate i.campaign female mtenure y2_topPerf y2_bonus y2_mentee 				children   HHallowance dir2-dir9 age1-age6 , vce (cluster campaign)
esttab using "Table4.txt", b(4) se(4) r2(3) star(* 0.1 ** 0.05 *** 0.01) label title(Table 4: Probability of applying: Campaigns data) /*
*/ nonumbers mtitles("(1)" "(2)" "(3)"  "(4)"   )  addnote("Campaign, department and age dummies included.") /*
*/ keep(female mtenure y2_topPerf y2_bonus y2_mentee  HHallowance   children  sumMatAdop sumPLeave  ) replace 

*-------------------------------------------------------------------------
*******Table 5: Probability of applying: Differential effects
*-------------------------------------------------------------------------

eststo clear  
eststo: regress candidate i.campaign female                                          mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, vce (cluster campaign) 
eststo: regress candidate i.campaign female children female_children                 mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, vce (cluster campaign)

eststo: regress candidate i.campaign female female_externalC                         mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6 , vce (cluster campaign) 
eststo: regress candidate i.campaign female                   com100 female_com100   mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, vce (cluster campaign)

eststo: regress candidate i.campaign female       Ducom100F     female_Ducom100F     mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6 , vce (cluster campaign) 
eststo: regress candidate i.campaign female female_externalC com100  female_com100     Ducom100F     female_Ducom100F       mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6 , vce (cluster campaign) 

esttab using "Table5.txt", b(4) se(4) r2(3) star(* 0.1 ** 0.05 *** 0.01) label title(Table 5: Probability of applying: Differential effects) /*
*/ nonumbers mtitles("(1)" "(2)" "(3)" "(4)" "(5)" "(6)" )  addnote("Campaign, department and age dummies included.") /*
*/ keep(female mtenure y2_topPerf y2_bonus y2_mentee children female_children   female_externalC  com100 female_com100 Ducom100F female_Ducom100F )replace 

*--------------------------------------------------------------------------
***Table A6: Probability of promotion: Campaign data
*--------------------------------------------------------------------------

eststo clear
eststo: regress offer i.campaign female mtenure y2_topPerf y2_bonus  y2_mentee                                               dir2-dir9 age1-age6   , vce (cluster pid)
eststo: regress offer i.campaign female mtenure y2_topPerf y2_bonus  y2_mentee    sumMatAdop sumPLeave  dir2-dir9 age1-age6   , vce (cluster pid)
eststo: regress offer i.campaign female mtenure y2_topPerf y2_bonus  y2_mentee  children HHallowance   dir2-dir9 age1-age6   , vce (cluster pid)
eststo: regress offer female mtenure y2_topPerf y2_bonus  y2_mentee  share_externalAppliccant lpanelsize gender_composition  dir2-dir9 age1-age6   , vce (cluster pid)



esttab using "TableA6.txt", b(5) se(5) r2(3) star(* 0.1 ** 0.05 *** 0.01) label title(Table 6: Probability of promotion: Campaign data) /*
*/ nonumbers mtitles("(1)" "(2)" "(3)" "(4)" )  addnote("Department and age dummies included. Campaign dummies also included except in (4)") /*
*/ keep(female mtenure y2_bonus y2_topPerf y2_mentee HHallowance children  share_externalAppliccant lpanelsize gender_composition sumMatAdop sumPLeave ) replace 



*--------------------------------------------------------------------------
***Table A7: Probability of promotion. heckman selection model
*--------------------------------------------------------------------------


eststo clear

eststo: heckman offer i.campaign female mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, /*
*/ select(candidate=i.campaign female mtenure y2_topPerf y2_bonus y2_mentee sumMatAdop  sumPLeave   dir2-dir9 age1-age6) twostep

eststo: heckman offer i.campaign female mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, /*
*/ select(candidate=i.campaign female mtenure y2_topPerf y2_bonus y2_mentee  children dir2-dir9 age1-age6) twostep

eststo: heckman offer i.campaign female mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, /*
*/ select(candidate=i.campaign female mtenure y2_topPerf y2_bonus y2_mentee HHallowance children   dir2-dir9 age1-age6) twostep


esttab   using "TableA7.txt",  b(4) se(4)  star(* 0.1 ** 0.05 *** 0.01) label title("able A7: Probability of promotion. Heckman selection model") /*
*/ nonumbers mtitles("(1)" "(2)" "(3)" )  addnote("Campaign, department and age dummies included.") keep(lambda female mtenure y2_topPerf y2_bonus y2_mentee sumMatAdop  sumPLeave  HHallowance children) replace 


*--------------------------------------------------------------------------
***Table A8: Probability of promotion conditional on having applied for promotion. Campaigns data
*--------------------------------------------------------------------------
gen offer_can=offer
replace offer_can=. if candidate==0

eststo clear
eststo: regress offer_can i.campaign female mtenure dir2-dir9 age1-age6 , vce (cluster campaign) 
eststo: regress offer_can i.campaign female mtenure y2_topPerf y2_bonus y2_mentee dir2-dir9 age1-age6, vce (cluster campaign) 
eststo: regress offer_can i.campaign female mtenure y2_topPerf y2_bonus y2_mentee children dir2-dir9 age1-age6, vce (cluster campaign) 

esttab using "TableA8.txt", b(4) se(4) r2(3) star(* 0.1 ** 0.05 *** 0.01) label title(Table A8: Probability of promotion conditional on having applied for promotion. Campaigns data) /*
*/ nonumbers mtitles("(1)" "(2)" "(3)"  )  addnote("Campaign, department and age dummies included.") /*
*/ keep(female mtenure y2_topPerf y2_bonus y2_mentee children) replace 


